package com.henry.base.problem;

import java.util.Arrays;

public class StatisticsCharsOfString {
    public static void main(String[] args) {
        String s = "wqurfaskjgalkqiowryfsjafkvkxzhgiuqwdfohfajsfpioiuyrqhnznvbzmxvzkoasfhajglquwirqir";
        fun1(s);

//        for (int i = 0; i < 255; i++) {
//            if ((char) i == '\n'||(char)i=='\r')
//                System.out.print('X');
//            else
//                System.out.print((char) i);
//            if (i % 10 == 9)
//                System.out.println();
//        }


    }

    //不考虑大小写，默认都是小写
    public static void fun1(String string) {
        int[] arr = new int[26];
        char[] chars = string.toCharArray();
        for (char c : chars) {
            int k = c - 97;
            arr[k]++;
        }

        System.out.println(Arrays.toString(arr));
    }


    public static void fun2(String string) {
        int[] arr = new int[26];

        char[] chars = string.toCharArray();
        for (char c : chars) {

        }

        System.out.println(Arrays.toString(arr));
    }
}
